<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.bootcss.com/semantic-ui/2.4.2/semantic.min.css" rel="stylesheet">
    <link th:href="@{/css/semantic.min.css}" rel="stylesheet">
    <meta charset="UTF-8">
    <title>商品展示</title>
    <style type="text/css">
        table{
            width: 100%;
            border-collapse: collapse;
        }

        table caption{
            font-size: 2em;
            font-weight: bold;
            margin: 1em 0;
        }

        th,td{
            border: 1px solid #999;
            text-align: center;
            padding: 20px 0;
        }

        table thead tr{
            background-color: #008c8c;
            color: #fff;
        }

        table tbody tr:nth-child(odd){
            background-color: #eee;
        }

        table tbody tr:hover{
            background-color: #ccc;
        }

        table tbody tr td:first-child{
            color: #f40;
        }

        table tfoot tr td{
            text-align: right;
            padding-right: 20px;
        }

    </style>
</head>
<body>
<div style="text-align: center">
    <form type="button" action="#"  th:action="@{/load}" method="post" style="margin: auto;text-align: center;display: inline-flex">
        <input type="submit"  class="ui teal button" value="加载数据" >
    </form>
    <form action="#" th:action="@{/qur}"  th:object="${goods}" th:method="post" style="margin: auto;text-align: center;display: inline-flex">
        <div class="ui input focus">
            <input type="text"  name="name" th:value="*{name}" placeholder="搜索..." />
        </div>

        <input type="submit"  class="ui primary button" value="查询"/>
    </form>


<table>
    <caption>商品展示</caption>
    <thead>
    <tr>
        <th>商品名称</th>
        <th>商品价格(元)</th>
        <th>市场价(元)</th>
        <th>折扣价(元)</th>
        <th>商品规格</th>
        <th>详细内容</th>
        <th>删除</th>
    </tr>
    </thead>
    <tbody>

    <tr th:each="goods:${msg}">

        <td th:text="${goods.getName()}"></td>
        <td th:text="${goods.getPrice()}*0.01"></td>
        <td th:text="${goods.getMarket_price()}*0.01"></td>
        <td th:text="(${goods.market_price}-${goods.getPrice()})*0.01"></td>
        <td th:text="${goods.getSpec()}"></td>
        <td th:text="${goods.getSub_title()}"></td>
        <td><a th:href="@{/del(name=${goods.getName()})}"> 删除 </a></td>
    </tr>
    </tbody>
</table>

</div>


</body>
</html>